]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
workspaceAnimation: Assign movingWindow before creating window actors
authorSebastian Keller <skeller@gnome.org>
Fri, 27 Feb 2026 12:22:37 +0000 (13:22 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Sat, 14 Mar 2026 17:39:25 +0000 (18:39 +0100)
The BaseWorkspaceGroup constructor calls _createWindows(), which uses
_shouldShowWindow() to determine which actors to create for the
animation.

In WorkspaceGroup _shouldShowWindow() this depends on a comparison with
this._movingWindow, which however only gets set after the
BaseWorkspaceGroup constructor has been called.

This was causing the moving window to no longer stick to the screen
when moved between workspaces.

Fixes: 96be47933 ("workspaceAnimation: Split out BaseWorkspaceGroup")
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8992
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/4092>
(cherry picked from commit 45fb9698a5a99ef9af7dc2155d6b6766818d5197)

js/ui/workspaceAnimation.js

index 7debd5ad42fb5a02db9585de14609f839167d128..06c5997286d3e245e6a2c54541a41e066a220526 100644 (file)
@@ -16,7 +16,7 @@ export const WORKSPACE_SPACING = 100;
 
 export const BaseWorkspaceGroup = GObject.registerClass(
 class BaseWorkspaceGroup extends Clutter.Actor {
-    constructor(workspace, monitor) {
+    constructor(workspace, monitor, movingWindow) {
         super({
             width: monitor.width,
             height: monitor.height,
@@ -25,6 +25,7 @@ class BaseWorkspaceGroup extends Clutter.Actor {
 
         this._workspace = workspace;
         this._monitor = monitor;
+        this._movingWindow = movingWindow;
         this._windowRecords = [];
 
         this._createBackground();
@@ -94,9 +95,7 @@ class BaseWorkspaceGroup extends Clutter.Actor {
 export const WorkspaceGroup = GObject.registerClass(
 class WorkspaceGroup extends BaseWorkspaceGroup {
     constructor(workspace, monitor, movingWindow) {
-        super(workspace, monitor);
-
-        this._movingWindow = movingWindow;
+        super(workspace, monitor, movingWindow);
 
         global.display.connectObject('restacked',
             () => this._syncStacking(), this);
@@ -150,6 +149,10 @@ class WorkspaceGroup extends BaseWorkspaceGroup {
 
 export const WorkspaceBackground = GObject.registerClass(
 class WorkspaceBackground extends BaseWorkspaceGroup {
+    constructor(workspace, monitor) {
+        super(workspace, monitor, null);
+    }
+
     _shouldShowWindow(window) {
         return this._isDesktopWindow(window) &&
             this._windowIsOnThisMonitor(window);